const { ipcMain } = require('electron');
const { getDownloadStore } = require("../../isMain/downLoad/fileUtils")
const { setTransferCompleteList, clearTransferCompleteList } = require("../../isMain/downLoad")
function transferEvent() {
  // 获取传输完成列表
  ipcMain.handle("getTransferList", () => {
    return getDownloadStore()
  })
  // 清空传输完成列表
  ipcMain.handle("clearTransferList", () => {
    return clearTransferCompleteList()
  })
  // 重新下载后重新设置传输完成列表(筛掉重新下载项)
  ipcMain.handle("redownloadStore", (event, params) => {
    return setTransferCompleteList(params)
  })
}
module.exports = {
  transferEvent
}